<h1>Person data</h1>
<div>
    <span>Current user:</span>
    <span id="current_user" class="current-user"></span>
    <button onclick="getPage('/page/login')">Change User</button>
</div>
<hr/>
<div>
    <label>Id:</label>
    <input id="person_id" type="number" value="{{ person_id }}" disabled>
</div>
<div>
    <label>Name:</label>
    <input id="person_name" type="text"
        {% if not can_write %}readonly{% endif %}
        value="{{ person_name }}"/>
</div>
{% if inserting %}
    <button
        {% if not can_write %}disabled{% endif %}
        onclick="savePerson('POST')">Insert</button>
{% else %}
    <button
        {% if not can_write %}disabled{% endif %}
        onclick="savePerson('PUT')">Update</button>
{% endif %}
<button onclick="getPage('/page/persons')">Cancel</button>
